<?php if (!defined('THINK_PATH')) exit();?>  <div class="nav">
    <div class="container clearfix">
      <div class="nav-left fl">
        <h3>留言板</h3>
      </div>
      <div class="nav-right fr">
        <?php if(empty($_SESSION['user']['username'])): ?><a class="nav-r-a" href="<?php echo U('User/login');?>">登录</a>
          <a class="nav-r-a" href="<?php echo U('User/register');?>">注册</a>
        <?php else: ?>
        <span class="nav-r-username">
          <strong>欢迎您！<?php echo ($_SESSION['user']['username']); ?></strong>
        </span>
        <a class="nav-r-a" href="/index.php/Guestbook/Index/post"><strong>发表留言</strong></a>
        <a class="nav-r-a" href="<?php echo U('User/logout');?>"><strong>退出登录</strong></a><?php endif; ?>
      </div>
    </div>
  </div>
  <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!-- <link rel="stylesheet" href="/Public/css/global.css"> -->
  <title>留言板</title>
  <style>
    *{margin: 0;padding: 0;}
    a{
      text-decoration: none;
      color: #666;
    }
    .fl{float: left;}
    .fr{float: right;}
    .clearfix::after,
    .clearfix::before{
      content: '';
      display: block;
      visibility: hidden;
      width: 0;
      height: 0;
      clear: both;
    }
    .container{
      margin: 0 auto;
      max-width: 980px;
    }
    .nav{
      width: 100%;
      height: 40px;
      line-height: 40px;
      color: #fff;
      background-color: #d73240;
    }
    .nav-r-a{
      margin-right: 4px;
      color: #ddd;
      font-size: 14px;
    }
    .nav-r-a:hover{
      color: orange;
    }
    .nav-r-username{
      margin-right: 8px;
      font-size: 14px;
    }
    .list-title{
      height: 50px;
      line-height: 50px;
      font-size: 12px;
      color: #666;
    }
    .is-author{
      margin-right: 8px;
      color: #444;
    }
    .list-cont{
      padding-bottom: 20px;
      border-bottom: 1px solid #eee;
    }
    .del-btn{
      margin-left: 12px;
    }
    .pages{
      padding: 22px 0;
    }
    /* .page .current{
      display: inline-block;
      width: 20px;
      height: 20px;
      line-height: 20px;
      text-align: center;
      color: #fff;
      background-color: #d73240;
    }
    .page a{
      display: inline-block;
      width: 20px;
      height: 20px;
      line-height: 20px;
      color: #666;
      text-align: center;
    } */
    .pages a,
			.pages span {
				display: inline-block;
				padding: 2px 8px;
				margin: 0 2px;
				border: 1px solid #f0f0f0;
				-webkit-border-radius: 3px;
				-moz-border-radius: 3px;
				border-radius: 3px;
			}
			
			.pages a,
			.pages li {
				display: inline-block;
				list-style: none;
				text-decoration: none;
				color: #d73240;
			}
			
			.pages a.first,
			.pages a.prev,
			.pages a.next,
			.pages a.end {
				margin: 0;
			}
			
			.pages a:hover {
				border-color: #d73240;
			}
			
			.pages span.current {
				background: #d73240;
				color: #FFF;
				font-weight: 700;
				border-color: #d73240;
			}
  </style>
</head>
<body>
  <div class="container">
    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?><div class="list-title clearfix">
          <p class="fl is-author">留言者：<?php echo ($item["username"]); ?></p>
          <p class="fl">留言时间：<?php echo (date("Y-m-d H:i:s",$item["createdat"])); ?></p>
          <p class="fl"> 
            <?php if(($_SESSION['user']['userId']) == $item["userid"]): ?><a class="del-btn" href="<?php echo U('delete?id='.$item['messageid']);?>" onclick="return confirm('确定删除此条留言？')">删除</a><?php endif; ?>
          </p>
        </div>
        <div class="list-cont clearfix"><p><?php echo ($item["content"]); ?></p></div><?php endforeach; endif; else: echo "" ;endif; ?>
  </div>
  <div class="pages container"><?php echo ($page); ?></div>
</body>
</html>